<!-- 预览xlsx，仅支持xlsx -->
<script setup lang="ts">
import VueOfficeExcel from '@vue-office/excel'
import '@vue-office/excel/lib/index.css'

const props = defineProps({
  /** 文件名 */
  fileName: String,
  /** 链接地址 */
  fileData: Blob,
  /** 渲染成功 */
  renderedHandler: Function,
  /** 渲染失败 */
  errorHandler: Function,
})
</script>
<template>
  <vue-office-excel
    :src="props.fileData"
    class="h-[100vh] w-full"
    @rendered="props.renderedHandler"
    @error="props.errorHandler"
  />
</template>

<style scoped>
:deep(.x-spreadsheet-sheet, .x-spreadsheet-overlayer, .x-spreadsheet-overlayer-content) {
  width: 100% !important;
}
</style>
